package com.framework.app.controller.index;

import cn.hutool.extra.servlet.ServletUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;


/**
 * 移动管理首页
 *
 * @author Kevin
 */
@RestController
public class AppIndexController {

    private static void writeIndex(HttpServletResponse response) {
        response.setCharacterEncoding("UTF-8");
        response.setHeader("Content-type", "text/html; charset=UTF-8");
        ServletUtil.getWriter(response).write("<h1 style=\"text-align: center;padding: 50px 0;\">欢迎访问API</h1>");
    }

    /**
     * 首页
     *
     * @param response
     */
    @GetMapping("/app/index")
    public void index(HttpServletResponse response) {
        writeIndex(response);
    }

}
